﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

public static class ListExtension
{
    static public T Random<T>(this List<T> lists)
    {
        return lists[UnityEngine.Random.Range(0, lists.Count)];
    }
    static public T Random<T>(this T[] array)
    {
        return array[UnityEngine.Random.Range(0, array.Length)];
    }

    static public T RandomPop<T>(this List<T> lists)
    {
        var data = lists[UnityEngine.Random.Range(0, lists.Count)];
        lists.Remove(data);
        return data;
    }

}

